package org.example.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.example.entity.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 用户实体类
 */
@Data
@TableName("sys_user")
public class User extends BaseEntity {
    @TableId(type = IdType.AUTO)    //主键自增长
    private Long id; //用户ID
    private String username;//用户名
    private String avatar;//头像
    private String password;//密码
    private String realname;//真实姓名
    private String mobile;//联系电话
    private String sex;//性别
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date birthday;//生日
    private String role;//角色身份
    private String address;//住址
    private Double money;//余额
    @TableField(exist = false)
    private String oldPassword;//旧密码
    @TableField(exist = false)
    private String validcode;//验证码
    @TableField(exist = false)
    private String clientUid;//客户端uid
}
